import { defineStore } from "pinia";
import {ref,computed} from 'vue'
export const useAllDateStore = defineStore('allData', () => {
  const isCollapse = ref(true)
  const menuWidth = computed(() => isCollapse.value ? '100px' : '300px')
  const headerWidth = computed(() => isCollapse.value ? '2400px' : '2250px')
  //ref  state
  //computed getter
  //function action

  // 切换方法
  const toggleCollapse = () => {
    isCollapse.value = !isCollapse.value
  }
  return { 
    isCollapse,menuWidth,toggleCollapse,headerWidth
   }
})